<template>
    <div class="app-container">
        <div class="Search">
            <!--工具条-->
            <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
                          <el-form-item v-has="'PLATFROM_TENANT_QUERY'">
                <el-cascader  ref="tenantTree" placeholder="所属租户" :props="tenantProps" :options="tenantOptions" @change="selectTenant" clearable collapse-tags filterable></el-cascader>
            </el-form-item>

             <el-form-item>
                 <el-cascader ref="organTree" placeholder="所属组织" :props="props" :options="organOptions" @change="selectOrgan" collapse-tags clearable filterable></el-cascader>
            </el-form-item>
                        <el-form-item>
    <el-input v-model="query.params.appId" placeholder="应用ID" />
</el-form-item>
  <el-form-item>
    <el-input v-model="query.params.orderId" placeholder="订单编号" />
</el-form-item>
<el-form-item>
    <el-date-picker v-model="query.params.gmtClose" type="date" placeholder="订单关闭时间">
    </el-date-picker>
</el-form-item>
                <el-form-item>
    <el-date-picker v-model="query.params.gmtClose" type="date" placeholder="订单关闭时间">
    </el-date-picker>
</el-form-item>
                                                <el-form-item>
    <el-date-picker v-model="query.params.gmtCreate" type="date" placeholder="订单生成">
    </el-date-picker>
</el-form-item>
                <el-form-item>
    <el-date-picker v-model="query.params.gmtCreate" type="date" placeholder="订单生成">
    </el-date-picker>
</el-form-item>
                                                <el-form-item>
    <el-date-picker v-model="query.params.gmtPayment" type="date" placeholder="支付时间">
    </el-date-picker>
</el-form-item>
                <el-form-item>
    <el-date-picker v-model="query.params.gmtPayment" type="date" placeholder="支付时间">
    </el-date-picker>
</el-form-item>
                                                                        <el-form-item>
    <el-input v-model="query.params.amount" placeholder="订单金额" />
</el-form-item>
                                                <el-form-item>
    <el-select v-model="query.params.status" placeholder="订单状态">
        <el-option
                v-for="item in query.options"
                :key="item.value"
                :label="item.label"
                :value="item.value">
        </el-option>
    </el-select>
</el-form-item>
                                <el-form-item>
    <el-input v-model="query.params.buyerId" placeholder="消费者ID" />
</el-form-item>
                                                        <el-form-item>
    <el-input v-model="query.params.body" placeholder="商品信息" />
</el-form-item>
                                                                                <el-form-item>
    <el-select v-model="query.params.discount" placeholder="折扣">
        <el-option
                v-for="item in query.options"
                :key="item.value"
                :label="item.label"
                :value="item.value">
        </el-option>
    </el-select>
</el-form-item>
                                <el-form-item>
    <el-input v-model="query.params.notifyId" placeholder="通知编号" />
</el-form-item>
                                                                                        <el-form-item>
    <el-input v-model="query.params.outTradeNo" placeholder="支付宝订单编号" />
</el-form-item>
                        <el-form-item>
    <el-input v-model="query.params.paymentType" placeholder="支付类型" />
</el-form-item>
                                                                                <el-form-item>
    <el-select v-model="query.params.price" placeholder="价格">
        <el-option
                v-for="item in query.options"
                :key="item.value"
                :label="item.label"
                :value="item.value">
        </el-option>
    </el-select>
</el-form-item>
                                                        <el-form-item>
    <el-select v-model="query.params.quantity" placeholder="数量">
        <el-option
                v-for="item in query.options"
                :key="item.value"
                :label="item.label"
                :value="item.value">
        </el-option>
    </el-select>
</el-form-item>
                                                        <el-form-item>
    <el-select v-model="query.params.refundStatus" placeholder="退款状态">
        <el-option
                v-for="item in query.options"
                :key="item.value"
                :label="item.label"
                :value="item.value">
        </el-option>
    </el-select>
</el-form-item>
                                <el-form-item>
    <el-input v-model="query.params.sellerEmail" placeholder="卖家邮箱" />
</el-form-item>
                                                        <el-form-item>
    <el-input v-model="query.params.sellerId" placeholder="卖家编号" />
</el-form-item>
                                                        <el-form-item>
    <el-input v-model="query.params.sign" placeholder="签名字段" />
</el-form-item>
                                                        <el-form-item>
    <el-input v-model="query.params.signType" placeholder="签名类型" />
</el-form-item>
                                                        <el-form-item>
    <el-input v-model="query.params.subject" placeholder="商品" />
</el-form-item>
                                                                                        <el-form-item>
    <el-input v-model="query.params.totalFee" placeholder="订单总额" />
</el-form-item>
                        <el-form-item>
    <el-input v-model="query.params.tradeNo" placeholder="交易单号" />
</el-form-item>
                                                        <el-form-item>
    <el-input v-model="query.params.tradeStatus" placeholder="交易状态" />
</el-form-item>
                                                        <el-form-item>
    <el-input v-model="query.params.useCoupon" placeholder="使用红包" />
</el-form-item>
                                                                                        <el-form-item>
    <el-input v-model="query.params.objectId" placeholder="物品编号" />
</el-form-item>
                                                        <el-form-item>
    <el-input v-model="query.params.objectTypeId" placeholder="物品类型编号" />
</el-form-item>
                                                        <el-form-item>
    <el-input v-model="query.params.createBy" placeholder="生成者" />
</el-form-item>
                                                        <el-form-item>
    <el-input v-model="query.params.updateBy" placeholder="更新者" />
</el-form-item>
                                <el-form-item>
    <el-date-picker v-model="query.params.createDate" type="date" placeholder="生成时间">
    </el-date-picker>
</el-form-item>
                <el-form-item>
    <el-date-picker v-model="query.params.createDate" type="date" placeholder="生成时间">
    </el-date-picker>
</el-form-item>
                                                <el-form-item>
    <el-date-picker v-model="query.params.updateDate" type="date" placeholder="更新时间">
    </el-date-picker>
</el-form-item>
                <el-form-item>
    <el-date-picker v-model="query.params.updateDate" type="date" placeholder="更新时间">
    </el-date-picker>
</el-form-item>
                                        <el-form-item>
    <el-input v-model="query.params.remark" placeholder="备注: 1：现金，2：红包，3：积分" />
</el-form-item>
                                            

<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="fetchData">查询</el-button>
</el-form-item>
<el-form-item>
<el-button type="success" icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
</el-form-item>
</el-form>
</el-col>
</div>

        <div class="block">
            <el-table
                    v-loading="listLoading"
                    :data="list"
                    element-loading-text="Loading"
                    border
                    fit
                    highlight-current-row
            >
                <el-table-column align="center" label="序号" width="95">
                    <template slot-scope="scope">
                        {{ scope.$index }}
                    </template>
                </el-table-column>

<el-table-column label="主键" width="110">
<template slot-scope="scope">
{{ scope.row.id }}
</template>
</el-table-column>
<el-table-column label="所属组织" width="110">
<template slot-scope="scope">
{{ scope.row.organId }}
</template>
</el-table-column>
<el-table-column label="应用ID" width="110">
<template slot-scope="scope">
{{ scope.row.appId }}
</template>
</el-table-column>
<el-table-column label="订单编号" width="110">
<template slot-scope="scope">
{{ scope.row.orderId }}
</template>
</el-table-column>
<el-table-column label="订单关闭时间" width="110">
<template slot-scope="scope">
{{ scope.row.gmtClose }}
</template>
</el-table-column>
<el-table-column label="订单生成" width="110">
<template slot-scope="scope">
{{ scope.row.gmtCreate }}
</template>
</el-table-column>
<el-table-column label="支付时间" width="110">
<template slot-scope="scope">
{{ scope.row.gmtPayment }}
</template>
</el-table-column>
<el-table-column label="订单金额" width="110">
<template slot-scope="scope">
{{ scope.row.amount }}
</template>
</el-table-column>
<el-table-column label="订单状态" width="110">
<template slot-scope="scope">
{{ scope.row.status }}
</template>
</el-table-column>
<el-table-column label="消费者ID" width="110">
<template slot-scope="scope">
{{ scope.row.buyerId }}
</template>
</el-table-column>
<el-table-column label="商品信息" width="110">
<template slot-scope="scope">
{{ scope.row.body }}
</template>
</el-table-column>
<el-table-column label="折扣" width="110">
<template slot-scope="scope">
{{ scope.row.discount }}
</template>
</el-table-column>
<el-table-column label="通知编号" width="110">
<template slot-scope="scope">
{{ scope.row.notifyId }}
</template>
</el-table-column>
<el-table-column label="支付宝订单编号" width="110">
<template slot-scope="scope">
{{ scope.row.outTradeNo }}
</template>
</el-table-column>
<el-table-column label="支付类型" width="110">
<template slot-scope="scope">
{{ scope.row.paymentType }}
</template>
</el-table-column>
<el-table-column label="价格" width="110">
<template slot-scope="scope">
{{ scope.row.price }}
</template>
</el-table-column>
<el-table-column label="数量" width="110">
<template slot-scope="scope">
{{ scope.row.quantity }}
</template>
</el-table-column>
<el-table-column label="退款状态" width="110">
<template slot-scope="scope">
{{ scope.row.refundStatus }}
</template>
</el-table-column>
<el-table-column label="卖家邮箱" width="110">
<template slot-scope="scope">
{{ scope.row.sellerEmail }}
</template>
</el-table-column>
<el-table-column label="卖家编号" width="110">
<template slot-scope="scope">
{{ scope.row.sellerId }}
</template>
</el-table-column>
<el-table-column label="签名字段" width="110">
<template slot-scope="scope">
{{ scope.row.sign }}
</template>
</el-table-column>
<el-table-column label="签名类型" width="110">
<template slot-scope="scope">
{{ scope.row.signType }}
</template>
</el-table-column>
<el-table-column label="商品" width="110">
<template slot-scope="scope">
{{ scope.row.subject }}
</template>
</el-table-column>
<el-table-column label="订单总额" width="110">
<template slot-scope="scope">
{{ scope.row.totalFee }}
</template>
</el-table-column>
<el-table-column label="交易单号" width="110">
<template slot-scope="scope">
{{ scope.row.tradeNo }}
</template>
</el-table-column>
<el-table-column label="交易状态" width="110">
<template slot-scope="scope">
{{ scope.row.tradeStatus }}
</template>
</el-table-column>
<el-table-column label="使用红包" width="110">
<template slot-scope="scope">
{{ scope.row.useCoupon }}
</template>
</el-table-column>
<el-table-column label="物品编号" width="110">
<template slot-scope="scope">
{{ scope.row.objectId }}
</template>
</el-table-column>
<el-table-column label="物品类型编号" width="110">
<template slot-scope="scope">
{{ scope.row.objectTypeId }}
</template>
</el-table-column>
<el-table-column label="生成者" width="110">
<template slot-scope="scope">
{{ scope.row.createBy }}
</template>
</el-table-column>
<el-table-column label="更新者" width="110">
<template slot-scope="scope">
{{ scope.row.updateBy }}
</template>
</el-table-column>
<el-table-column label="生成时间" width="110">
<template slot-scope="scope">
{{ scope.row.createDate }}
</template>
</el-table-column>
<el-table-column label="更新时间" width="110">
<template slot-scope="scope">
{{ scope.row.updateDate }}
</template>
</el-table-column>
<el-table-column label="备注: 1：现金，2：红包，3：积分" width="110">
<template slot-scope="scope">
{{ scope.row.remark }}
</template>
</el-table-column>

                <el-table-column align="center" prop="created_at" label="操作" width="200">
                    <template slot-scope="scope">
                        <span class="el-tag el-tag--info el-tag--mini" style="cursor: pointer;" @click="handleEdit(scope.$index, scope.row)">
                          {{ scope.row.isSet?'保存':"修改" }}
                        </span>
                        <span v-if="!scope.row.isSet" class="el-tag el-tag--danger el-tag--mini" style="cursor: pointer;" @click="handleDelete(scope.$index, scope.row)">
                          删除
                        </span>
                    </template>
                </el-table-column>
            </el-table>
        </div>

        <div class="block">
            <el-pagination
                    :current-page="currentPage"
                    :page-sizes="[10, 20, 30, 40]"
                    :page-size="pageSize"
                    layout="total, sizes, prev, pager, next, jumper"
                    :total="total"
                    @size-change="handleSizeChange"
                    @current-change="handleCurrentChange"
            />
        </div>

        <div class="block">
            <!--弹框-->
            <el-dialog :title="titleMap[dialogStatus]" :visible.sync="dialogFormVisible">
                <el-form :model="form">

                    <el-form-item v-if="addForVisible" label="角色Id">
                        <el-input v-model="form.id" auto-complete="off" />
                    </el-form-item>

                <el-form-item label="主键">
    <el-input v-model="form.id" placeholder="主键"  auto-complete="off"/>
</el-form-item>
                    <el-form-item label="所属组织">
    <el-input v-model="form.organId" placeholder="所属组织"  auto-complete="off"/>
</el-form-item>
        <el-form-item label="应用ID">
    <el-input v-model="form.appId" placeholder="应用ID"  auto-complete="off"/>
</el-form-item>
                                <el-form-item label="订单编号">
    <el-input v-model="form.orderId" placeholder="订单编号"  auto-complete="off"/>
</el-form-item>
            <el-form-item label="订单关闭时间">
    <el-date-picker v-model="form.gmtClose" type="date" placeholder="订单关闭时间">
    </el-date-picker>
</el-form-item>
                    <el-form-item label="订单生成">
    <el-date-picker v-model="form.gmtCreate" type="date" placeholder="订单生成">
    </el-date-picker>
</el-form-item>
                    <el-form-item label="支付时间">
    <el-date-picker v-model="form.gmtPayment" type="date" placeholder="支付时间">
    </el-date-picker>
</el-form-item>
                            <el-form-item label="订单金额">
    <el-input v-model="form.amount" placeholder="订单金额"  auto-complete="off"/>
</el-form-item>
                <el-form-item label="订单状态">
    <el-select v-model="form.status" placeholder="订单状态">
        <el-option
                v-for="item in query.options"
                :key="item.value"
                :label="item.label"
                :value="item.value">
        </el-option>
    </el-select>
</el-form-item>
            <el-form-item label="消费者ID">
    <el-input v-model="form.buyerId" placeholder="消费者ID"  auto-complete="off"/>
</el-form-item>
                    <el-form-item label="商品信息">
    <el-input v-model="form.body" placeholder="商品信息"  auto-complete="off"/>
</el-form-item>
                            <el-form-item label="折扣">
    <el-select v-model="form.discount" placeholder="折扣">
        <el-option
                v-for="item in query.options"
                :key="item.value"
                :label="item.label"
                :value="item.value">
        </el-option>
    </el-select>
</el-form-item>
            <el-form-item label="通知编号">
    <el-input v-model="form.notifyId" placeholder="通知编号"  auto-complete="off"/>
</el-form-item>
                                <el-form-item label="支付宝订单编号">
    <el-input v-model="form.outTradeNo" placeholder="支付宝订单编号"  auto-complete="off"/>
</el-form-item>
        <el-form-item label="支付类型">
    <el-input v-model="form.paymentType" placeholder="支付类型"  auto-complete="off"/>
</el-form-item>
                            <el-form-item label="价格">
    <el-select v-model="form.price" placeholder="价格">
        <el-option
                v-for="item in query.options"
                :key="item.value"
                :label="item.label"
                :value="item.value">
        </el-option>
    </el-select>
</el-form-item>
                    <el-form-item label="数量">
    <el-select v-model="form.quantity" placeholder="数量">
        <el-option
                v-for="item in query.options"
                :key="item.value"
                :label="item.label"
                :value="item.value">
        </el-option>
    </el-select>
</el-form-item>
                    <el-form-item label="退款状态">
    <el-select v-model="form.refundStatus" placeholder="退款状态">
        <el-option
                v-for="item in query.options"
                :key="item.value"
                :label="item.label"
                :value="item.value">
        </el-option>
    </el-select>
</el-form-item>
            <el-form-item label="卖家邮箱">
    <el-input v-model="form.sellerEmail" placeholder="卖家邮箱"  auto-complete="off"/>
</el-form-item>
                    <el-form-item label="卖家编号">
    <el-input v-model="form.sellerId" placeholder="卖家编号"  auto-complete="off"/>
</el-form-item>
                    <el-form-item label="签名字段">
    <el-input v-model="form.sign" placeholder="签名字段"  auto-complete="off"/>
</el-form-item>
                    <el-form-item label="签名类型">
    <el-input v-model="form.signType" placeholder="签名类型"  auto-complete="off"/>
</el-form-item>
                    <el-form-item label="商品">
    <el-input v-model="form.subject" placeholder="商品"  auto-complete="off"/>
</el-form-item>
                                <el-form-item label="订单总额">
    <el-input v-model="form.totalFee" placeholder="订单总额"  auto-complete="off"/>
</el-form-item>
        <el-form-item label="交易单号">
    <el-input v-model="form.tradeNo" placeholder="交易单号"  auto-complete="off"/>
</el-form-item>
                    <el-form-item label="交易状态">
    <el-input v-model="form.tradeStatus" placeholder="交易状态"  auto-complete="off"/>
</el-form-item>
                    <el-form-item label="使用红包">
    <el-input v-model="form.useCoupon" placeholder="使用红包"  auto-complete="off"/>
</el-form-item>
                                <el-form-item label="物品编号">
    <el-input v-model="form.objectId" placeholder="物品编号"  auto-complete="off"/>
</el-form-item>
                    <el-form-item label="物品类型编号">
    <el-input v-model="form.objectTypeId" placeholder="物品类型编号"  auto-complete="off"/>
</el-form-item>
                    <el-form-item label="生成者">
    <el-input v-model="form.createBy" placeholder="生成者"  auto-complete="off"/>
</el-form-item>
                    <el-form-item label="更新者">
    <el-input v-model="form.updateBy" placeholder="更新者"  auto-complete="off"/>
</el-form-item>
            <el-form-item label="生成时间">
    <el-date-picker v-model="form.createDate" type="date" placeholder="生成时间">
    </el-date-picker>
</el-form-item>
                    <el-form-item label="更新时间">
    <el-date-picker v-model="form.updateDate" type="date" placeholder="更新时间">
    </el-date-picker>
</el-form-item>
                <el-form-item label="备注: 1：现金，2：红包，3：积分">
    <el-input v-model="form.remark" placeholder="备注: 1：现金，2：红包，3：积分"  auto-complete="off"/>
</el-form-item>
                </el-form>

<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false">取 消</el-button>
<el-button type="primary" @click="handleEditSave">确 定</el-button>
</div>
</el-dialog>
</div></div>
    </div>

</template>

<script>
    import { getList, doDelete, doEdit } from '@/api/AplipayChargeOrderDetail/'
    export default {
        data() {
            return {
                list: null,
                listLoading: true,
                total: 5,
                currentPage: 1,
                pageSize: 10,
                dialogFormVisible: false,
                addForVisible: false,
                form: {
                    id:'',
                    organId:'',
                    appId:'',
                    orderId:'',
                    gmtClose:'',
                    gmtCreate:'',
                    gmtPayment:'',
                    amount:'',
                    status:'',
                    buyerId:'',
                    body:'',
                    discount:'',
                    notifyId:'',
                    outTradeNo:'',
                    paymentType:'',
                    price:'',
                    quantity:'',
                    refundStatus:'',
                    sellerEmail:'',
                    sellerId:'',
                    sign:'',
                    signType:'',
                    subject:'',
                    totalFee:'',
                    tradeNo:'',
                    tradeStatus:'',
                    useCoupon:'',
                    objectId:'',
                    objectTypeId:'',
                    createBy:'',
                    updateBy:'',
                    createDate:'',
                    updateDate:'',
                    remark:''
                },
                // 新增or编辑弹框标题(根据点击的新增or编辑按钮显示不同的标题)
                titleMap: {
                    add: '新增',
                    edit: '编辑'
                },
                // 新增和编辑弹框标题
                dialogStatus: '',
                query: {
                    params: {
                        id:'',
                        organId:'',
                        appId:'',
                        orderId:'',
                        gmtClose:'',
                        gmtCreate:'',
                        gmtPayment:'',
                        amount:'',
                        status:'',
                        buyerId:'',
                        body:'',
                        discount:'',
                        notifyId:'',
                        outTradeNo:'',
                        paymentType:'',
                        price:'',
                        quantity:'',
                        refundStatus:'',
                        sellerEmail:'',
                        sellerId:'',
                        sign:'',
                        signType:'',
                        subject:'',
                        totalFee:'',
                        tradeNo:'',
                        tradeStatus:'',
                        useCoupon:'',
                        objectId:'',
                        objectTypeId:'',
                        createBy:'',
                        updateBy:'',
                        createDate:'',
                        updateDate:'',
                        remark:''
                    },
                    timeValue: '',
                    options: [{
                        value: '1',
                        label: '黄金糕'
                    }, {
                        value: '2',
                        label: '双皮奶'
                    }],
                    value: ''
                }
            }
        },
        created() {
            this.fetchData()
        },
        methods: {
            fetchData() {
                this.listLoading = true
                getList(this.query.params , this.currentPage, this.pageSize).then(response => {
                    const data = response.data
                    this.total = data.totalCount
                this.pageSize = data.pageSize
                this.currentPage = data.currentPage
                this.list = data.entities
                this.listLoading = false
            })
            },
            handleSizeChange(val) {
                this.currentPage = 1
                this.pageSize = val
            },
            handleCurrentChange(val) {
                this.currentPage = val
            },
            // 新增
            handleAdd() {
                // 显示弹框
                this.dialogFormVisible = true
                // 新增弹框标题
                this.dialogStatus = 'add'

                                    this.form.id=''
                                    this.form.organId=''
                                    this.form.appId=''
                                    this.form.orderId=''
                                    this.form.gmtClose=''
                                    this.form.gmtCreate=''
                                    this.form.gmtPayment=''
                                    this.form.amount=''
                                    this.form.status=''
                                    this.form.buyerId=''
                                    this.form.body=''
                                    this.form.discount=''
                                    this.form.notifyId=''
                                    this.form.outTradeNo=''
                                    this.form.paymentType=''
                                    this.form.price=''
                                    this.form.quantity=''
                                    this.form.refundStatus=''
                                    this.form.sellerEmail=''
                                    this.form.sellerId=''
                                    this.form.sign=''
                                    this.form.signType=''
                                    this.form.subject=''
                                    this.form.totalFee=''
                                    this.form.tradeNo=''
                                    this.form.tradeStatus=''
                                    this.form.useCoupon=''
                                    this.form.objectId=''
                                    this.form.objectTypeId=''
                                    this.form.createBy=''
                                    this.form.updateBy=''
                                    this.form.createDate=''
                                    this.form.updateDate=''
                                    this.form.remark=''
                                this.addForVisible = false
            },
            // 编辑
            handleEdit(index, row) {
                console.log(index)
                console.log(row)
                                this.form.id=row.id
                                this.form.organId=row.organId
                                this.form.appId=row.appId
                                this.form.orderId=row.orderId
                                this.form.gmtClose=row.gmtClose
                                this.form.gmtCreate=row.gmtCreate
                                this.form.gmtPayment=row.gmtPayment
                                this.form.amount=row.amount
                                this.form.status=row.status
                                this.form.buyerId=row.buyerId
                                this.form.body=row.body
                                this.form.discount=row.discount
                                this.form.notifyId=row.notifyId
                                this.form.outTradeNo=row.outTradeNo
                                this.form.paymentType=row.paymentType
                                this.form.price=row.price
                                this.form.quantity=row.quantity
                                this.form.refundStatus=row.refundStatus
                                this.form.sellerEmail=row.sellerEmail
                                this.form.sellerId=row.sellerId
                                this.form.sign=row.sign
                                this.form.signType=row.signType
                                this.form.subject=row.subject
                                this.form.totalFee=row.totalFee
                                this.form.tradeNo=row.tradeNo
                                this.form.tradeStatus=row.tradeStatus
                                this.form.useCoupon=row.useCoupon
                                this.form.objectId=row.objectId
                                this.form.objectTypeId=row.objectTypeId
                                this.form.createBy=row.createBy
                                this.form.updateBy=row.updateBy
                                this.form.createDate=row.createDate
                                this.form.updateDate=row.updateDate
                                this.form.remark=row.remark
                                this.addForVisible = true
                // 显示弹框
                this.dialogFormVisible = true
                // 编辑弹框标题
                this.dialogStatus = 'edit'
            },
            handleDelete(index, row) {
                console.log(index)
                console.log(row)

                this.$confirm('此操作将永久删除该记录, 是否继续?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning',
                    center: true
                }).then(() => {
                    doDelete(row.id).then(response => {
                    const data = response.data
                    console.log(data)
                    if(data.status == 1){
                        this.$message({
                            type: 'success',
                            message: '操作成功!'
                        })
                        this.fetchData();
                    }else if(data.status == 403){
                        this.$message({
                            type: 'warning',
                            message: data.description
                        })
                }else{
                    this.$message({
                        type: 'info',
                        message: '操作失败!'
                    })
                }
            })
            }).catch(() => {
                    this.$message({
                    type: 'info',
                    message: '已取消删除'
                })
            })
            },
            handleEditSave() {
                debugger

                doEdit(this.form).then(response => {
                    debugger
                            console.log(response)
                    const data = response.data
                    if(data.status){
                        this.$message({
                            type: 'success',
                            message: '操作成功!'
                        })
                     this.fetchData();
                    }else{
                        this.$message({
                            type: 'info',
                            message: '操作失败!'
                        })
                    }
                    this.listLoading = false
                    this.dialogFormVisible = false
            })
            },
            handleReset() {
                this.$confirm('此操作将永久删除该记录, 是否继续?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning',
                    center: true
                }).then(() => {
                    this.$message({
                    type: 'success',
                    message: '删除成功!'
                })
            }).catch(() => {
                    this.$message({
                    type: 'info',
                    message: '已取消删除'
                })
            })
            }
        }
    }
</script>
